<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>padding</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background-color: gold;
            margin-bottom: 10px;
        }

        div.box1 {
            padding: 10px;
            border: 2px solid #000;
        }

        div.box2 {
            padding-top: 10px;
            padding-right: 20px;
            padding-bottom: 30px;
            padding-left: 40px;
        }

        div.box3 {
            padding: 10px 20px 30px 40px;
        }
        div.box4{
            padding: 10px 20px 30px;
        }
        div.box5{
            padding: 10px 20px;
        }
    </style>
</head>

<body>
    <div class="box1"> padding</div>
    <div class="box2">方向:上-右-下-左</div>
    <div class="box3">方向:上-右-下-左(简写)</div>
    <div class="box4">方向:上-左右-下</div>
    <div class="box5">方向:上下-左右</div>
</body>

</html>